(defun phi (n)
  (* n (reduce #'* (mapcar #'(lambda (x) (- 1 (/ 1 x))) (distinct-factors n)))))

(defun is-valid(n)
  (same-digits n (phi n)))

(defun probl070 (max)
  (loop for i from 1 to max when (is-valid i) collect i))